package leetcode.easy.q1614;

import java.util.Stack;

class Solution {
    public int maxDepth(String s) {
        int current=0,max=0;
        char[] chars = s.toCharArray();
        for (int i = 0; i < chars.length; i++) {
            if (chars[i]=='('){
                current++;
                max=Math.max(current,max);
            }else if ((chars[i]==')')){
                current--;
            }

        }

        return max;
    }

    public static void main(String[] args) {

    }
}